<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: ajax_products_tooltip.php 135 2013-09-22 07:30:55Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 135 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:30:55 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright © since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	© 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	© 2002-2003 osCommerce - www.oscommerce.com
* 	© 2003     nextcommerce - www.nextcommerce.org
* 	© 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

chdir('../../../');
include('includes/application_top.php');

$data = $db->db_query("SELECT
							pd.products_name,
							pd.products_short_description,
							p.products_image
						FROM
							".TABLE_PRODUCTS." AS p
							JOIN ".TABLE_PRODUCTS_DESCRIPTION." AS pd ON (pd.products_id = p.products_id AND pd.language_id = '".(int)$_SESSION['languages_id']."')
						AND
							p.products_id = '".(int)$_GET['pID']."'");

$c  = '	<table cellpadding="4" style="max-width: 560px"><tr>';
if(file_exists(DIR_WS_INFO_IMAGES.$data->fields['products_image']))
	$c .= '		<td valign="top"><img class="mr10 tooltip_img" src="'.DIR_WS_INFO_IMAGES.$data->fields['products_image'].'" alt="" /></td>';
$c .= '	<td valign="top">';
$c .= '		<h3>'.$data->fields['products_name'].'</h3>';

if(strlen($data->fields['products_short_description']) > 300)
	$c .= substr($data->fields['products_short_description'], 0, 300).' [...]';
else
	$c .= $data->fields['products_short_description'];

$c .= '	</td>';
$c .= '	</tr><table>';
echo $c;
?>